package com.jt.feign;

import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;
//此对象作为feign方式的远程调用异常处理对象
@Component
public class ProviderFallbackFactory
        implements FallbackFactory<RemoteProviderService> {
    @Override
    public RemoteProviderService create(Throwable throwable) {
        return new RemoteProviderService() {
            @Override
            public String echoMsg(String msg) {
                //
                return "服务维护中";
            }
        };
    }
}
